package com.dingqb.mycs.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.dingqb.mycs.GestureMainAct;
import com.dingqb.mycs.R;
import com.dingqb.mycs.ui.activity.MoveImageActivity;

public class MainTab4Fragment extends Fragment implements OnClickListener {
	ImageView iv_move;
	TextView main_page;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_maintab04, container, false);
		initView(view);
		return view;
	}

	private void initView(View view) {
		iv_move = (ImageView) view.findViewById(R.id.iv_move);
		iv_move.setOnClickListener(this);
		main_page = (TextView) view.findViewById(R.id.main_page);
		main_page.setOnClickListener(this);

	}

	@Override
	public void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		System.out.println("MainSettingFragment--onResume");
	}

	@Override
	public void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		System.out.println("MainSettingFragment--onPause");
	}

	@Override
	public void onClick(View v) {
		if (v.getId() == R.id.iv_move) {
			Intent intent = new Intent(getActivity(), MoveImageActivity.class);
			getActivity().startActivity(intent);

		} else if (v.getId() == R.id.main_page) {
			Intent intent = new Intent(getActivity(), GestureMainAct.class);
			getActivity().startActivity(intent);
		}

	}

}
